<!--
 * @Author: wangming
 * @Date: 2021-04-01 14:02:25
 * @LastEditors: wangming
 * @LastEditTime: 2021-05-06 16:37:08
 * @Description: file content
-->
<template>
  <el-form-item label="币种">
    <el-select
      v-model="value.__config.currency"
      @change="clearOtherUnit"
      placeholder="请选择"
      style="width: 100%"
    >
      <el-option label="其他" value=""></el-option>
      <el-option
        :label="i.value"
        :value="i.key"
        :key="index"
        v-for="(i, index) in TABLE_CURRENCY_ENUM"
      >
      </el-option>
    </el-select>
    <el-input
      class="mt10"
      v-if="!value.__config.currency"
      v-model="value.__config.otherUnit"
      placeholder="请输入内容"
    ></el-input>
  </el-form-item>
</template>

<script>
import { TABLE_CURRENCY_ENUM } from '@/utils/enum';
import basicmixins from './basicmixins';
export default {
  mixins: [basicmixins],
  data() {
    return {
      TABLE_CURRENCY_ENUM,
    };
  },
  methods: {
    clearOtherUnit(event){
      if(!event) this.value.__config.otherUnit = "";
    }
  },
};
</script>

<style lang="scss" scoped></style>
